<?php

class Model_LibraryAcl extends Zend_Acl {

     public function __construct() {

        $this->add(new Zend_Acl_Resource('authentification'));
        $this->add(new Zend_Acl_Resource('visiteur'));
        $this->add(new Zend_Acl_Resource('listerv'), 'visiteur');
        $this->add(new Zend_Acl_Resource('gererv'), 'visiteur');
        $this->add(new Zend_Acl_Resource('modifierv'), 'visiteur');
        $this->add(new Zend_Acl_Resource('supprimerv'), 'visiteur');
        $this->add(new Zend_Acl_Resource('ajouterv'), 'visiteur');
        $this->add(new Zend_Acl_Resource('comptable'));
        $this->add(new Zend_Acl_Resource('listerc'), 'comptable');
        $this->add(new Zend_Acl_Resource('gererc'), 'comptable');
        $this->add(new Zend_Acl_Resource('modifierc'), 'comptable');
        $this->add(new Zend_Acl_Resource('supprimerc'), 'comptable');
        $this->add(new Zend_Acl_Resource('ajouterc'), 'comptable');
        $this->add(new Zend_Acl_Resource('frais'));
        $this->add(new Zend_Acl_Resource('listerf'), 'frais');
        $this->add(new Zend_Acl_Resource('gererf'), 'frais');
        $this->add(new Zend_Acl_Resource('modifierf'), 'frais');
        $this->add(new Zend_Acl_Resource('stat'));
        $this->add(new Zend_Acl_Resource('cumulVisiteur'), 'stat');
        $this->add(new Zend_Acl_Resource('cumulFrais'), 'stat');
        $this->add(new Zend_Acl_Resource('error'));



        $this->addRole(new Zend_Acl_Role('user'));
        $this->addRole(new Zend_Acl_Role('admin'), 'user');

        $this->allow('user', 'authentification');
        $this->allow('user', 'visiteur','listerv');
        $this->allow('user', 'frais','listerf');
        $this->allow('user', 'comptable','listerc');

        $this->allow('admin', 'stat');
        $this->allow('admin','visiteur','gererv');
        $this->allow('admin','visiteur','ajouterv');
        $this->allow('admin','visiteur','modifierv');
        $this->allow('admin','visiteur','supprimerv');
        $this->allow('admin','comptable','gererc');
        $this->allow('admin','comptable','ajouterc');
        $this->allow('admin','comptable','modifierc');
        $this->allow('admin','comptable','supprimerc');
        $this->allow('admin','frais','gererf');
        $this->allow('admin','frais','modifierf');
    }

}

?>
